﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using DataAccessClasses;

namespace eschoolBO
{
    public class bannerslide
    {
        iDAC DAC = DACFactory.GetDAC();
        private long _b_id = -99;
        private string _b_image = "";
        private string _b_description = "";
        private string _b_place = "";
        private string _isactive = "";
        private bool _isdeleted = false;
        public long b_id
        {
            get
            {
                return _b_id;
            }
            set
            {
                _b_id = value;
            }
        }
        public string b_image
        {
            get
            {
                return _b_image;
            }
            set
            {
                _b_image = value;
            }
        }
        public string b_description
        {
            get
            {
                return _b_description;
            }
            set
            {
                _b_description = value;
            }
        }
        public string b_place
        {
            get
            {
                return _b_place;
            }
            set
            {
                _b_place = value;
            }
        }
        public string isactive
        {
            get
            {
                return _isactive;
            }
            set
            {
                _isactive = value;
            }
        }
        public bool isdeleted
        {
            get
            {
                return _isdeleted;
            }
            set
            {
                _isdeleted = value;
            }
        }
        public long SaveRecords()
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@b_id",b_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@b_image", b_image, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@b_description", b_description, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@b_place", b_place, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@isactive", isactive, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam5 = DAC.Parameter("@isdeleted", isdeleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4, dbparam5 };
                return DAC.Save("banner_save", dbparamcall);
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return -99;
        }
        public DataTable GetRecords(long b_id, string b_image, string b_description, string b_place, string isactive, bool isdeleted, string paraandor)
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@b_id", b_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@b_image", b_image, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@b_description", b_description, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@b_place", b_place, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@isactive", isactive, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam5 = DAC.Parameter("@isdeleted", isdeleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter dbparam6 = DAC.Parameter("@paraandor", paraandor, DbType.AnsiString, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4, dbparam5, dbparam6};
                DataTable dt1 = DAC.Select("banner_get", dbparamcall);
                return dt1;
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return null;
        }
    }
}
